package C_Paper;

import java.util.Scanner;

public class C100_6 {
    //密码输入检测
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String o = sc.next();
        int d = 0;
        int x = 0;
        int s = 0;
        int t = 0;
        char[] oo = o.toCharArray();
        for (int i = 1; i < oo.length; i++) {
            if (oo[i] == '<' || oo[i-1] == '<') {
                continue;
            }else if (oo[i-1] >= 'A' && oo[i-1] <= 'Z')
                d++;
            else if (oo[i-1] >= 'a' && oo[i-1] <= 'z') {
                x++;
            } else if (oo[i-1] >= '0' && oo[i-1] <= '9') {
                s++;
            } else {
                t++;
            }
        }
        System.out.println(d > 0 && x > 0 && s > 0 && t > 0 && d+x+s+t >= 8);
    }
}
